/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package entity;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Collection;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Lob;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author PARINYA
 */
@Entity
@Table(name = "m_hotel")
@NamedQueries({
    @NamedQuery(name = "MHotel.findAll", query = "SELECT m FROM MHotel m"),
    @NamedQuery(name = "MHotel.findById", query = "SELECT m FROM MHotel m WHERE m.id = :id"),
    @NamedQuery(name = "MHotel.findByName", query = "SELECT m FROM MHotel m WHERE m.name = :name"),
    @NamedQuery(name = "MHotel.findByHotelLevel", query = "SELECT m FROM MHotel m WHERE m.hotelLevel = :hotelLevel"),
    @NamedQuery(name = "MHotel.findByLatitude", query = "SELECT m FROM MHotel m WHERE m.latitude = :latitude"),
    @NamedQuery(name = "MHotel.findByLongtitude", query = "SELECT m FROM MHotel m WHERE m.longtitude = :longtitude")})
public class MHotel implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "ID")
    private Long id;
    @Basic(optional = false)
    @Column(name = "Name")
    private String name;
    @Lob
    @Column(name = "Location")
    private String location;
    @Column(name = "HotelLevel")
    private String hotelLevel;
    @Column(name = "Latitude")
    private BigDecimal latitude;
    @Column(name = "Longtitude")
    private BigDecimal longtitude;
    @OneToMany(mappedBy = "mHotel")
    private Collection<SrcCureplanDoctor> srcCureplanDoctorCollection;
    @OneToMany(mappedBy = "mHotel")
    private Collection<SrvCureplan> srvCureplanCollection;

    public MHotel() {
    }

    public MHotel(Long id) {
        this.id = id;
    }

    public MHotel(Long id, String name) {
        this.id = id;
        this.name = name;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getLocation() {
        return location;
    }

    public void setLocation(String location) {
        this.location = location;
    }

    public String getHotelLevel() {
        return hotelLevel;
    }

    public void setHotelLevel(String hotelLevel) {
        this.hotelLevel = hotelLevel;
    }

    public BigDecimal getLatitude() {
        return latitude;
    }

    public void setLatitude(BigDecimal latitude) {
        this.latitude = latitude;
    }

    public BigDecimal getLongtitude() {
        return longtitude;
    }

    public void setLongtitude(BigDecimal longtitude) {
        this.longtitude = longtitude;
    }

    public Collection<SrcCureplanDoctor> getSrcCureplanDoctorCollection() {
        return srcCureplanDoctorCollection;
    }

    public void setSrcCureplanDoctorCollection(Collection<SrcCureplanDoctor> srcCureplanDoctorCollection) {
        this.srcCureplanDoctorCollection = srcCureplanDoctorCollection;
    }

    public Collection<SrvCureplan> getSrvCureplanCollection() {
        return srvCureplanCollection;
    }

    public void setSrvCureplanCollection(Collection<SrvCureplan> srvCureplanCollection) {
        this.srvCureplanCollection = srvCureplanCollection;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof MHotel)) {
            return false;
        }
        MHotel other = (MHotel) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entity.MHotel[id=" + id + "]";
    }

}
